<?php

namespace app\admin\validate;

use think\Validate;

class Evaluation extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
   
        'superior_score'    => 'between:0,5',
        'self_score'        => 'between:0,5',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'self_score.between'        => '评分只能0-5',
        'superior_score.between'    => '评分只能0-5',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['self_score','superior_score'],
        'edit' => ['self_score','superior_score'],
    ];
    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'self_score'        => __('Self_score'),
            'superior_score'    => __('Superior_score'),
           
        ];
        parent::__construct($rules, $message, $field);
    }
}
